Skip to content

Conversation

@BwanaFr
Copy link

@BwanaFr BwanaFr commented Oct 17, 2025

Dear Patrick,

This pull request suppress some compilation warnings with ESP32 Arduino toolchain.

@patricklaf
Copy link
Owner

Hello @BwanaFr ,
Thank you for contibuting.
Part of your PR is already addressed in just merged PR #20.
For the other part, can you explain the interest of the static_cast?
ESP32 compiled with latest core 3.3.2 doesn't show any warning.

@BwanaFr
Copy link
Author

BwanaFr commented Oct 22, 2025

Hello,

Sorry for the late reply.
If I don't type cast the enum, I get this kind of warning.
SNMP/src/BER.h:289:66: warning: bitwise operation between different enumeration types 'SNMP::Class::<unnamed enum>' and 'SNMP::Form::<unnamed enum>' is deprecated [-Wdeprecated-enum-enum-conversion]

@patricklaf
Copy link
Owner

Hello,
With latest core I dont' get this warning.
What platform are you using?

@BwanaFr
Copy link
Author

BwanaFr commented Oct 23, 2025

I'm using PlatformIO with pioarduino version 54.0.3.20 (https://github.com/pioarduino/platform-espressif32#54.03.20).
I think this platform enable -Wall GCC option.

@patricklaf
Copy link
Owner

Hello,
OK.
May be the best way to solve these warnings is to change from uint8_t to uint16_t Form and Class enums?
Can you try and tell me if it works?

@BwanaFr
Copy link
Author

BwanaFr commented Oct 24, 2025

Hi,

I've tested what you propose but I still get the warning message.
Maybe the cast I made (to int32_t) is not appropriate. I think it's more appropriate to cast to uint16_t.

@patricklaf
Copy link
Owner

Hello,
Can you try this syntax?

Boolean = +Class::Universal | +Form::Primitive | 0x01,    /**< 0x01 */

@BwanaFr BwanaFr marked this pull request as draft October 30, 2025 09:56
@BwanaFr
Copy link
Author

BwanaFr commented Oct 30, 2025

Hello,

It works well with this syntax (and it's cleaner :) )

I've updated the PR to integrate these modifications.
Thanks

@BwanaFr BwanaFr marked this pull request as ready for review October 30, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants